<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>智能排班系统</title>
    <meta name="description" content="智能排班系统">
    <meta name="keywords" content="智能排班系统">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <style type="text/css">
        .el-main {
            position: absolute;
            top: 70px;
            bottom: 0px;
            left: 200px;
            right: 10px;
            padding: 0;
        }
    </style>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div id="app">
    <el-container>
        <el-header class="main-header" style="height:70px;">
            <nav class="navbar navbar-static-top" :class=''>
                <!-- Logo -->
                <span href="#" class="logo" style="text-align:center">
                        <span class="logo-lg"><h5 style="font-size:25px; margin-top: 5px;color: green">智能排班</h5></span>
                    </span>
                <span href="#" class="logo" style="text-align:center; margin-left: 300px;">
                        <span class="logo-lg"><h5 style="font-size:25px; margin-top: 5px;color: green; ">欢迎您:{{username}}</h5></span>
                    </span>
                <span href="#" class="logo" style="text-align:center ; margin-left: 400px;">
                        <span class="logo-lg"><h5 style="font-size:25px; margin-top: 5px;color: green; ">当前时间:{{dateTime}}</h5></span>
                    </span>
                <el-button type="primary" plain class="butT" @click="exit()" style="margin-top: 22px">退出系统</el-button>
            </nav>
        </el-header>
        <el-container>
            <el-aside width="200px">
                <el-menu>
                    <el-submenu v-for="menu in menuList" :index="menu.path">
                        <template slot="title">
                            <a :href="menu.linkUrl" target="right" class="fa" :class="menu.icon" style="color: black">{{menu.title}}</a>
                        </template>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-container>
                <iframe name="right" class="el-main" src="../img/logingBg.png" width="100%" height="580px"
                        frameborder="0"></iframe>
            </el-container>
        </el-container>
    </el-container>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            username: null,
            dateTime: null,
            menuList: [
                // {
                //     "path": "1",
                //     "title": "人员管理",
                //     "icon":"fa-user-md",
                //     "linkUrl":"user.html",
                // },
                // {
                //     "path": "2",
                //     "title": "排班管理",
                //     "icon":"fa-tty",
                //     "linkUrl":"dutyList.html",
                // },
                // {
                //     "path": "3",
                //     "title": "排班查询",
                //     "icon":"fa-stethoscope",
                //     "linkUrl":"queryDutyList.html",
                // }
            ]
        },
        method: {
            exit() {
                axios.post("/user/exit").then(() => {
                    location.href = "/pages/index.html"
                })
            }
        },
        created() {
            //发送ajax请求，获取当前登录用户的用户名，用于页面展示
            axios.get("/user/getLoginUsername").then((res) => {
                app.menuList = res.data.data.menuList;
                app.username = res.data.data.username;
                app.dateTime = res.data.data.dateTime;
            });
        }
    });
    $(function () {
        var wd = 200;
        $(".el-main").css('width', $('body').width() - wd + 'px');
    });
</script>
</html>
